<template>
  <div class="system_wrap">
    <div class="system_box" v-if="system.length > 0">
      <!-- 系统信息 -->
      <div class="system" v-for="(item,index) in system" :key="index">
        <div class="systemHer">
          <span>{{item.title}}</span>
          <span>{{item.add_time}}</span>
          <span>></span>
        </div>
        <div class="systemTail">
          <text v-html="item.content"></text>
        </div>
      </div>
    </div>
    <div v-else class="tishi">暂无系统信息</div>
  </div>
</template>

<script>
export default {
  props: {

  },
  data() {
    return {
      id: '',
      system: []
    };
  },
  onShow() {
    let user = ''
    let mobile =  wx.getStorageSync("mobile")
    this.request({
      url: this.baseUrl + '/api/edit/waterUser',
      data:{
        type: 1,
        mobile: mobile
      },
      method: 'POST',
    })
    .then(result=>{
			// console.log(result)
			if(result.status == 200){
        user = result.data.user_login
        this.id = user.id
        // /api/wechatapp/systemNotice
        this.request({
          url: this.baseUrl + "/api/wechatapp/systemNotice",
          data: {
            water_user_id: this.id
          },
          method: "GET",
        })
        .then((result) => {
          // console.log(result)
          if (result.status == 200) {
            // console.log(result.data)
            this.system = result.data.list.data
          } else {
            wx.showToast({
              title: result.msg,
              icon: "none",
            });
          }
        })
			} else {
        return false
			}
    })
    // user = wx.getStorageSync('userInfo')
    
  },
  computed: {

  },
  created() {

  },
  mounted() {

  },
  watch: {

  },
  methods: {

  },
  components: {

  },
};
</script>

<style scoped >
.system_wrap {
  width: 100%;
  height: auto;
}
.system {
  background-color: #ffffff;
  border-radius: 16rpx;
  margin: 20rpx;
}
.systemHer {
  display: flex;
  justify-content: space-between;
  padding: 30rpx;
  border-bottom: 1px solid #f5f5f5;
}
.systemHer > span:nth-child(3) {
  color: #cccccc;
}
.systemHer > span:nth-child(2) {
  margin-right: 240rpx;
}
.systemTail {
  padding: 30rpx;
  color: #999999;
}
</style>
